<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>对任意数组进行排序</title>
		<script type="text/javascript">
			//使用冒泡排序对数组进行从大到小的排序
			function sort(arr) {
				//外循环计算要循环的趟数
				for(var i = 0; i <= arr.length-1; i++) {
					//内循环计算每趟循环的次数
					for(var j = 0; j <= arr.length - i - 1; j++) {
						if(arr[j] < arr[j+1]){
							var temp = arr[j]
							arr[j] = arr[j+1];
							arr[j+1] = temp;
						}
					}
				}
				return arr;
			}
			console.log(sort([2,1,3,5,4,6,7]))
			
			console.log(Math.max(...[99,1,2]))
		</script>
		
	</head>
	<body>
	</body>
</html>
